{% extends "common/layout.html" %}
{% block content %}


    <div class="row">
        <div class="row col-sm-12">
            <div class="col-sm-2">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="查找通知" name="searchtitle">
                </div>
            </div>
            <div class="col-sm-1">
                <button type="submit" class="btn btn-primary do-search">查找</button>
            </div>
             {% if current_user.company == '西北区域公司' %}
            <div class="col-sm-1 col-sm-offset-8">
                <button type="button" class="btn btn-success" data-toggle="modal"
                        data-target="#exampleModal" style="margin-left: 10px"><span
                        class="glyphicon glyphicon-open"
                        aria-hidden="true"></span>上传通知
                </button>
            </div>
            {% endif %}
        </div>

        <script type="text/javascript">
            {#搜索#}
            var dosearch = {
                init: function () {
                    this.eventBind()
                },
                eventBind: function () {
                    $(".do-search").click(function () {
                        var title = $("input[name=searchtitle]").val();
                        var urlindex = common_ops.buildUrl("/search?title=") + title;
                        document.location.href = urlindex;

                    });
                }
            };
            $(document).ready(function () {
                dosearch.init();
            });
        </script>


        <div class="col-sm-4">
            <div class="panel panel-primary">

                <div class="panel-heading">通知规定</div>

                <ul class="list-group" style="height: 650px">
                    {% for item in classone %}
                        <a class="list-group-item" href="{{ item.url }}">{{ item.title }}</a>
                    {% endfor %}
                </ul>

                {#        分页#}
                {% if pagesone %}
                    <div class="row" style="margin-right:5px">
                        <div class="col-md-12">
                            <ul class="pagination pull-right">
                                {% if pagesone.is_prev == 1 %}
                                    <li>
                                        <a href="{{ pagesone.url }}&p={{ pagesone.current - 1 }}"
                                           aria-label="Previous">
                                            <span aria-hidden="true">上一页</span>
                                        </a>
                                    </li>
                                {% endif %}

                                {% for idx in pagesone.range %}
                                    <li {% if pagesone.current == idx %} class="active" {% endif %}  ><a
                                            href="{{ pagesone.url }}&p={{ idx }}">{{ idx }}</a></li>
                                {% endfor %}
                                {% if pagesone.is_next == 1 %}
                                    <li>
                                        <a href="{{ pagesone.url }}&p={{ pagesone.current + 1 }}" aria-label="Next">
                                            <span aria-hidden="true">下一页</span>
                                        </a>
                                    </li>
                                {% endif %}
                            </ul>
                        </div>
                    </div>
                {% endif %}
            </div>


        </div>


        <div class="col-sm-4">
            <div class="panel panel-primary">

                <div class="panel-heading">制度流程</div>

                <ul class="list-group" style="height: 650px">
                    {% for item in classtwo %}
                        <a class="list-group-item" href="{{ item.url }}">{{ item.title }}</a>
                    {% endfor %}
                </ul>

                {#        分页#}
                {% if pagestwo %}
                    <div class="row" style="margin-right:5px">
                        <div class="col-md-12">
                            <ul class="pagination pull-right">
                                {% if pagestwo.is_prev == 1 %}
                                    <li>
                                        <a href="{{ pagestwo.url }}&p={{ pagestwo.current - 1 }}"
                                           aria-label="Previous">
                                            <span aria-hidden="true">上一页</span>
                                        </a>
                                    </li>
                                {% endif %}

                                {% for idx in pagestwo.range %}
                                    <li {% if pagestwo.current == idx %} class="active" {% endif %}  ><a
                                            href="{{ pagestwo.url }}&p={{ idx }}">{{ idx }}</a></li>
                                {% endfor %}
                                {% if pagestwo.is_next == 1 %}
                                    <li>
                                        <a href="{{ pagestwo.url }}&p={{ pagestwo.current + 1 }}" aria-label="Next">
                                            <span aria-hidden="true">下一页</span>
                                        </a>
                                    </li>
                                {% endif %}
                            </ul>
                        </div>
                    </div>
                {% endif %}
            </div>


        </div>


        <div class="col-sm-4">
            <div class="panel panel-primary">

                <div class="panel-heading">承建商库</div>

                <ul class="list-group" style="height: 650px">
                    {% for item in classthree %}
                        <a class="list-group-item" href="{{ item.url }}">{{ item.title }}</a>
                    {% endfor %}
                </ul>

                {#        分页#}
                {% if pagesthree %}
                    <div class="row" style="margin-right:5px">
                        <div class="col-md-12">
                            <ul class="pagination pull-right">
                                {% if pagesthree.is_prev == 1 %}
                                    <li>
                                        <a href="{{ pagesthree.url }}&p={{ pagesthree.current - 1 }}"
                                           aria-label="Previous">
                                            <span aria-hidden="true">上一页</span>
                                        </a>
                                    </li>
                                {% endif %}

                                {% for idx in pagesthree.range %}
                                    <li {% if pagesthree.current == idx %} class="active" {% endif %}  ><a
                                            href="{{ pagesthree.url }}&p={{ idx }}">{{ idx }}</a></li>
                                {% endfor %}
                                {% if pagesthree.is_next == 1 %}
                                    <li>
                                        <a href="{{ pagesthree.url }}&p={{ pagesthree.current + 1 }}" aria-label="Next">
                                            <span aria-hidden="true">下一页</span>
                                        </a>
                                    </li>
                                {% endif %}
                            </ul>
                        </div>
                    </div>
                {% endif %}
            </div>


        </div>


    </div>



    {#    模态框#}
    <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
        <div class="modal-dialog" role="document">
            {#    等待模态#}
            <div class="modal fade" id="loadingModal">
                <div style="width: 200px;height:20px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
                    <div class="progress progress-striped active" style="margin-bottom: 0;">
                        <div class="progress-bar" style="width: 100%;"></div>
                    </div>
                    <h5 style="color:black"><strong>正在上传文件，请耐心等待...</strong></h5>
                </div>
            </div>


            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="exampleModalLabel">上传通知公告</h4>
                </div>
                <div class="modal-body">




                    {#暂存变量#}
{#                    <input class="form-control" id="pid" name="pid" style="display:none" value="{{ bookindex.id }}">#}
{#                    <input class="form-control" id="sn" name="sn" style="display:none" value="{{ bookindex.sn }}">#}
{#                    <input class="form-control" id="uid" name="uid" style="display:none" value="{{ current_user.id }}">#}

                    <div class="form-group">
                        <label class="control-label">类型:</label>
                        <select class="form-control " name="type" id="type">
                            <option>通知规定</option>
                            <option>制度流程</option>
                            <option>承建商库</option>
                        </select>
                    </div>








                    <div class="form-group">
                        <label class="control-label">上传图片:</label>
                        <div id="input">
                            <input id="upload_input" class="admin img-fluid" type="file" multiple="multiple">
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button class="btn btn-success do-upload" enctype="multipart/form-data">确定上传
                        </button>
                    </div>


                </div>
            </div>
        </div>
    </div>



{% endblock %}


{% block js %}
     <script src="{{ buildStaticUrl('/js/index/index.js') }}"></script>
{% endblock %}




